package fdq.mapper;

import fdq.pojo.Message;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface MessageMapper {
    @Select("select * from messages")
    public Message[] selectAllMessages();


    @Select("select * from messages where mname = #{mname}")
    public Message[] selectMessagesByName(String mname);


    @Insert("insert into messages(mname, message) values(#{mname}, #{message})")
    public int insertMessage(Message message);


    @Delete("delete from messages where mid = #{mid}")
    public int deleteMessage(int mid);

}
